// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license


#include "ActionShortcuts.h"

// - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

namespace
{
// Overloaded functions disambiguation

void (*PrimitiveTypeFunc1)(ActionManager&, ref<GeometryNode>, ref<Primitive>) 
    = &postPrimitiveTypeAction;
void (*PrimitiveTypeFunc2)(ActionManager&, ref<GeometryNode>, PrimitiveType) 
    = &postPrimitiveTypeAction;

void (*scaleNodeFunc1)(ActionManager&, ref<TransformNode>, const gx::Vec3&) 
    = &postScaleNodeAction;
void (*scaleNodeFunc2)(ActionManager&, ref<TransformNode>, double) 
    = &postScaleNodeAction;
}


void pyInitActionShortcuts()
{
    // Actions with the node manager
    bpy::def("removeAllNodes", postRemoveAllNodesAction);

    // Actions to modify the local transformation of a TransformNode
    bpy::def("moveNode", postMoveNodeAction);
    bpy::def("rotateNode", postRotateNodeAction);
    bpy::def("scaleNode", scaleNodeFunc1);
    bpy::def("scaleNode", scaleNodeFunc2);
    
    // Actions to change the shape type (Cube, Sphere, etc.) of a GeometryNode
    bpy::def("changePrimitiveType", PrimitiveTypeFunc1);
    bpy::def("changePrimitiveType", PrimitiveTypeFunc2);
}
